package com.mdhw.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mdhw.common.base.PageData;
import com.mdhw.config.R;
import com.mdhw.system.entity.SysAccount;
import com.mdhw.system.entity.SysUser;
import com.mdhw.system.entity.SysUserRole;
import com.mdhw.system.vo.*;
import org.springframework.web.multipart.MultipartFile;
import org.w3c.dom.stylesheets.LinkStyle;

import java.util.List;

/**
* @author Huang
* @date 2022-03-10
*/
public interface SysUserService extends IService<SysUser> {

    public R<String> updateXian();
    public R<PageData<SysUserVo>> selectListPage(Long pageNo,Long pageSize,String loginName,Long roleId);


    /**
     * 修改用户
     * @param sysUserVo
     * @return
     */
    public R<String> updateSysUser(SysUserVo sysUserVo);
    /**
     * 登录
     * @param sysUser
     * @return
     */
    public R<String> login(SysUser sysUser);

    /**
     * 验证密码登录
     * @param sysUser
     * @return
     */
    R<SysUserVo> authPwd(SysUserVo sysUser);

    public R<SysUserVo> authPwdByCode(SysUser sysUser);
    /**
     * 后台登录
     * @param sysUser
     * @return
     */
    R<SysUserVo> authPwdHoutai(SysUser sysUser);

    public SysUserVo getUserVoByToken();

    /**
     * 系统用户新增
     * @param sysUserVo
     * @return
     */
    public R<String> addSysUser(SysUserVo sysUserVo);



    /**
     * 系统用户删除
     * @param id
     * @return
     */
    public R<String> deleteSysUser(Long id);

    public R<String> addSysUserRole(SysUserVo sysUserVo);

    public R<SysUserVo> getUserInfo(Long id);

    /**
     * 判断用户是否是系统管理员
     * @param id
     * @return
     */
    boolean isSystemAdmin(Long id);

    /**
     * 判断用户是否是平台
     * @param id
     * @return
     */
    boolean isPlatform(Long id);

    /**
     * 判断用户是发是供应商
     * @param id
     * @return
     */
    boolean isChannel(Long id);

    /**
     * 获取用户详情通过 token
     * @return
     */
    public SysUserVo selectUserByToken();

    /**
     * 获取系统名称
     * @param userId
     * @return
     */
    String findSystemNameByUserId(String userId);


    /**
     * 查询供应商列表
     * @return
     */
    List<SysUserVo> selectChannelList(String keyWords);

    /**
     * 查询渠道商列表
     * @param keyWords
     * @return
     */
    public List<SysUserVo> selectBusinessList(String keyWords);

    /**
     * 供应商渠道商列表
     * @param pageNo
     * @param pageSize
     * @param loginName
     * @param type
     * @return
     */
    R<PageData<SysUserVo>> listChanneOrBusiness(Long pageNo, Long pageSize, String loginName, String type,String keyWords);

    /**
     * 重置密码
     * @param sysUserResetVo
     * @return
     */
    R<String> resetPassword(SysUserResetVo sysUserResetVo);

    /**
     * 修改密码
     * @param sysUserVo
     * @return
     */
    R<String> updatePwd(SysUserVo sysUserVo);

    /**
     * 获取供应商列表下拉框
     * @param keyWords 关键字
     * @return
     */
    R<List<SysUserVo>> selectChannelNoPermissionList(String keyWords);

    /**
     * 渠道主用户列表
     * @return
     */
    R<PageData<SysUserVo>> selectQudaozhuUserList(Integer pageNo,Integer pageSize,String loginName,String name,String phone);

    /**
     * 设置奖励比例
     * @param sysUserVo
     * @return
     */
    /*public R<String> setRewardRote(SysUserVo sysUserVo);*/

    /**
     * 查询达人列表
     * @param pageNo
     * @param pageSize
     * @param qudaozhu
     * @param loginName
     * @param name
     * @return
     */
    R<PageData<SysUserVo>> selectDarenListpage(Integer pageNo, Integer pageSize, Long qudaozhu, String loginName, String name);

    /**
     * 代理用户新增
     * @param sysUserVo
     * @return
     */
/*
    public R<String> addDailiUser(SysUserVo sysUserVo);
*/

    /**
     * 渠道达人列表
     * @return
     */
    List<SysUserTree> selectQuDaoDaren();

    // 编辑代理用户
    public R<String> updateDailiUser(SysUserVo sysUserVo);

    // 新增渠道主
    /*public R<String> addQudaozhu(SysUserVo sysUserVo);*/

    // 编辑渠道主
    public R<String> updateQudaozhu(SysUserVo sysUserVo);

    // 渠道主下拉列表
    public R<List<SysUser>> selectQudaoZhuList();

    // 注册
    public R<String> register(SysUserVo sysUserVo);

    public R<String> checkCode(String phone,String code,String type);

    // 发送验证码
    public R<String> sendCode(String phone, String type, Boolean aTrue);

    public List<LianheShangjiaVo> selectLianheShangjiaList();

    R<String> uploadHeaderUrl(MultipartFile uploadFile);

    public R<TuanduiVo> selectTuanduiVo();

    public R<String> updatePayPwd(SysUserVo sysUserVo);

    public R<PageData<SysUserVo>> selectRegisterListPage(Integer pageNo, Integer pageSize, String startTime, String endTime,Long levelId,String phone,Long id,String pPhone);


    public R<String> setYaoqingma(SysUserVo sysUserVo);

    public R<String> uploadLiangfangImage(MultipartFile uploadFile,Long id);

    public R<String> updateXianLevelCount();

    public R<List<SysUser>> selectSysUserGuanxi(Long id);

    public R<String> dongjieUser(SysUserVo sysUserVo);

    public R<PageData<SysUserVo>> selectShangwuPageData(Long pageNo, Long pageSize);

    public R<String> qiangzhiLogOut(SysAccount sysAccount);

    public R<String> kefuUploadHeaderUrl(MultipartFile uploadFile);

    public R<List<SysUserXianVo>> selectSysUserXianVoList(Long id);

    public R<SysRewardInfoVo> selectRewardInfoVo();

    public R<SysRewardInfoVo> selectRewardRuleVo();

    public R<String> zhuxiaoZhanghao();
}
